import request from '@/utils/request'

// 获取活动详细信息
export function getOneMyJoinActive(activeId) {
  return request({
    'url': '/myActive/'+activeId,
    headers: {
      isToken: true
    },
    'method': 'get',
    timeout: 20000
  })
}

// 获取所有个人参加的活动
export function getAllMyJoinActive(active) {
  return request({
    'url': '/myActive/list/'+active,
    headers: {
      isToken: true
    },
    'method': 'get',
    timeout: 20000
  })
}

// 退出个人参加的活动
export function exitOneMyJoinActive(activeId) {
  return request({
    'url': '/myActive/'+activeId,
    headers: {
      isToken: true
    },
    'method': 'delete',
    timeout: 20000
  })
}

// 根据传入状态获取暖心团和服务队活动
export function getActiveByActions(action){
	return request({
		'url':'/active/list/'+action,
		Headers:{
			isToken:true
		},
		'method':'get',
		timeout:20000
	})
}

// ww获取单个活动信息
export function getActiveByIactiveId(activeId){
	return request({
		'url':'/active/'+activeId,
		'method':'get',
		headers:{
			isToken:true
		},
		timeout:20000
	})
}

// 加入活动
export function JoinActive(activeId){
	return request({
		'url':'/active/'+activeId,
		'method':'put',
		headers:{
			isToken:true
		},
		timeout:20000
	})
}

// 删除活动
export function deleteOneMyActive(activeId) {
  return request({
    'url': '/active/'+activeId,
    headers: {
      isToken: true
    },
    'method': 'delete',
    timeout: 20000
  })
}

// 修改活动
export function updateActive(data) {
  return request({
    url: '/active',
    method: 'put',
    data: data
  })
}

